<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>美滴滴-就近美容服务</title>
	<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link type="text/css" rel="stylesheet" media="screen" href="__FONT__/css/style.css{$JSDEBUG}"/>
    <link type="text/css" rel="stylesheet" media="screen" href="__FONT__/css/media.css{$JSDEBUG}"/>
</head>
<body style="background:#eee;">
	<div class="outer">
		<h1 class="header"><a href="tel:{$service_hotline}"></a><p><if condition="$select_city">{$select_city|str_replace='市','',###}<else />{$currentCity}</if></p></h1>
	    <div class="fugai"></div>
	    <div class="head_dress_cha">
	        <ul class="clear">
	            <foreach name="citys" item="city">
	            <li data-province="{$city.province}" data-city="{$city.city}">{$city.format_city}</li>
	            </foreach>
	        </ul>
	        <span>更多城市正在筹备中</span>
	     </div>
        <div class="inner beauty_sec">
           <div class="beauty_sec_navlist navbgcolor lists">
             <header class="beauty_head">
                <div id="focus" class="focus">
					<div class="hd listhd">
						<ul></ul>
					</div>
					<div class="bd">
						<ul>
							<if condition="$carousels">
							<foreach name="carousels" item="carousel">
							<li><a href="#"><img src="__FONT__/images/beautycare_08.jpg" data-original="__UPLOADS__/Home/Carousel/{$carousel.img_name}"/></a></li>
							</foreach>
							<else />
							<li><a href="#"><img src="__FONT__/images/beautycare_08.jpg" data-original="__FONT__/images/banner_4.jpg"/></a></li>
							<li><a href="#"><img src="__FONT__/images/beautycare_08.jpg" data-original="__FONT__/images/banner_1.jpg"/></a></li>
							<li><a href="#"><img src="__FONT__/images/beautycare_08.jpg" data-original="__FONT__/images/banner_2.jpg"/></a></li>
							<li><a href="#"><img src="__FONT__/images/beautycare_08.jpg" data-original="__FONT__/images/banner_3.jpg"/></a></li>
							</if>
						</ul>
					</div>
				</div>
    		</header>
    		
    		<ul class="beautlist">
    			{:W('ServiceItem/items')}
				<h4></h4>
    		</ul>
    		</div>
        </div>
	</div>
	<include file="Public/footer" /> 
	<div class="addceng" style="display:none;">
	    <h1>提示</h1>
	    <p></p>
	    <a href="#" onclick="$('.addceng').hide();">取消</a>
	    <a href="#" id="goGpsLocation">确定</a>
	</div>
	<script src="__FONT__/js/zepto.min.js"></script>
<!-- 	<script src="__FONT__/js/dropload.min.js"></script> -->
	

<script type="text/javascript" src="__FONT__/js/zepto.picLazyLoad.js"></script>
<script type="text/javascript" charset="utf-8">
$(function () {
	$("img").picLazyLoad({
		scrollElm : $('.inner'),
	});
});
</script>
<script type="text/javascript" src="__FONT__/js/zepto.cookie.js"></script>
<script type="text/javascript" src="__FONT__/js/TouchSlide.1.1.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.3"></script>
<script type="text/javascript">
	var detectLocation = {$detectLocation};
	TouchSlide({ 
		slideCell:"#focus",
		titCell:".hd ul", //开启自动分页 autoPage:true ，此时设置 titCell 为导航元素包裹层
		mainCell:".bd ul", 
		effect:"left", 
		autoPlay:true,//自动播放
		autoPage:true, //自动分页
		switchLoad:"_src" //切换加载，真实图片路径为"_src" 
	});
	
	function showLocationInfo(pt, rs){
		var addComp = rs.addressComponents;
		
		 var select_city = localStorage.getItem('select_city');
		 if (!select_city && addComp.city) {
			 var currentTime = new Date().getTime();
			 var $expires = currentTime + 7 * 24 * 3600 * 1000;
			 
			 $.cookie('select_province', addComp.province, $expires);
			 $.cookie('select_city', addComp.city, $expires);
			 $.ajax({
				 url: '{:U("/User/saveUserCity")}',
				 data: {
					 province: addComp.province,
					 city: addComp.city
				 },
				 dataType: 'json',
				 success: function (result) {
					 
				 }
			 });
		 } else {
		 	// && !$('.head_dress_cha li[data-city="'+addComp.city+'"]').length
			if (detectLocation == 1 && select_city && addComp.city != select_city ) {
				 $(".addceng").find('p').html('您当前选择的城市为'+select_city+'，是否切换至'+addComp.city+'？');
				 $(".addceng").show();
				 
				 $('#goGpsLocation').click(function () {
					 $(".header p").text(addComp.city.replace('市', ""));
					 $.cookie('select_province', addComp.province, $expires);
					 $.cookie('select_city', addComp.city, $expires);
					 $.ajax({
						 url: '{:U("/User/saveUserCity")}',
						 data: {
							 province: addComp.province,
							 city: addComp.city
						 },
						 dataType: 'json',
						 success: function (result) {
							 $(".addceng").hide();
						 }
					 });
				});
			 }
		 }
	}
	
	$(function(){
		  var select_city = localStorage.getItem('select_city');
		  if (select_city) {
			  $(".head_dress_cha li").each(function (i, n) {
				  var dataCity = $(n).attr('data-city');
				  if (select_city == dataCity) {
					  $(".header p").text(dataCity.replace('市', ""));
					  $(n).addClass('cur').siblings().removeClass('cur');
				  }
			  });
		  } else {
			  	$(".fugai").show();
				$(".outer .header").css('box-shadow','none').css('border-bottom','#e6e6e6 solid 1px');
				$(".head_dress_cha").addClass('animatdown').removeClass('animatup');
		  }
		  
		  $(".beauty_head p").click(function(){
			  $(".head_dress_cha").slideToggle();
			  $(".beauty_head p").each(function() {
	             	if($(this).hasClass('cur')){
				   		$(this).removeClass('cur');
				  	}else{
					  	$(this).addClass('cur');
					}
	           });
		  });
		  
		  
		  $(".head_dress_cha ul li").click(function(){
			  $(this).addClass('cur').siblings().removeClass('cur');
			  
			  var province = $(this).attr('data-province'),
			  	city = $(this).attr('data-city');
			  
			  var currentTime = new Date().getTime();
				 var expires = currentTime + 7 * 24 * 3600 * 1000;
				 
			  localStorage.setItem('select_province', province);
			  localStorage.setItem('select_city', city);
			  
			  $.cookie('select_province', province, expires);
			  $.cookie('select_city', city, expires);
				
			  $.ajax({
				 url: '{:U("/User/saveUserCity")}',
				 data: {
					 province: province,
					 city: city
				 },
				 dataType: 'json',
				 success: function (result) {
					 
				 }
			 });
		  });
		  
		  $(".outer .header p").click(function(){
			  if($(".head_dress_cha").hasClass('animatdown')){
				  $(".fugai").hide();
				  $(".outer .header").css('box-shadow','#ddd 0px 2px 8px').css('border-bottom','none');
				  $(".head_dress_cha").addClass('animatup').removeClass('animatdown');
				  }else{
					 $(".fugai").show();
					 $(".outer .header").css('box-shadow','none').css('border-bottom','#e6e6e6 solid 1px');
					 $(".head_dress_cha").addClass('animatdown').removeClass('animatup');
					  }
			  
              });
		  $(".fugai").click(function(){
			  $(".fugai").hide();
			  $(".head_dress_cha").addClass('animatup').removeClass('animatdown');
		  });
		  $(".head_dress_cha ul li").click(function(){
			  $(".outer .header p").html($(this).html())
			  $(this).addClass('cur').siblings().removeClass('cur');
	          $(".fugai").hide();
			  $(".outer .header").css('box-shadow','#ddd 0px 2px 8px').css('border-bottom','none');
		      $(".head_dress_cha").addClass('animatup').removeClass('animatdown');       
	      });
      });
</script>

<include file="Public/share-js" />
</body>
</html>